#ifndef RTSP_SERVICE_CHASHTABLE_H
#define RTSP_SERVICE_CHASHTABLE_H

typedef struct CHashNode {
    char *str;              //数据字符串
    union{
        int (*fun)(void *);
        unsigned int id;
    }data;//附加数据
    struct CHashNode *next;  //哈希冲突单词
} CHashNode;

typedef struct CHashTable {
    unsigned int table_len;     //哈希表长度
    struct CHashNode **table;   //哈希表指针
} CHashTable;

extern unsigned int CHashTable_ELFHash(char *str);

extern void CHashTable_init(CHashTable *table, struct CHashNode **tablebuf, unsigned int nodeptr_number);

extern int CHashTable_insert(CHashTable *table, CHashNode *node);

extern void *CHashTable_search(CHashTable *table, char *str);

#endif //RTSP_SERVICE_CHASHTABLE_H
